/* 统一样式文件 - 解决页面布局不一致问题 */

:root {
    /* 颜色变量 - 统一配色方案 */
    --primary: #1976d2;
    --primary-light: #42a5f5;
    --primary-dark: #0d47a1;
    --primary-gradient: linear-gradient(135deg, #1976d2, #42a5f5);
    --secondary: #ff9800;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --gray: #757575;
    --gray-light: #f5f5f5;
    --gray-dark: #424242;
    --text-color: #333333;
    --bg-color: #f8f9fa;
    
    /* 阴影变量 */
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.15);
    
    /* 边框圆角 */
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
    
    /* 布局变量 */
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 60px;
    --header-height: 70px;
    --content-padding: 24px;
    --transition-speed: 0.3s;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow: hidden;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* 应用容器 - 统一布局 */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(to bottom, #2c3e50, #34495e);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    z-index: 10;
    color: #ecf0f1;
    transition: width var(--transition-speed) ease;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* 侧边栏切换按钮 */
.sidebar-toggle {
    position: absolute;
    top: 20px;
    right: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* Logo样式 */
.logo {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: var(--header-height);
}

.logo img {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.logo-text {
    font-size: 16px;
    font-weight: 600;
    color: #ecf0f1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity var(--transition-speed);
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
}

/* 导航菜单 */
.nav-menu {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.nav-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* 导航项 */
.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    margin: 4px 8px;
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.nav-icon {
    width: 24px;
    margin-right: 12px;
    font-size: 16px;
    text-align: center;
}

.nav-text {
    white-space: nowrap;
    transition: opacity var(--transition-speed);
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(5px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.7), rgba(52, 152, 219, 0.4));
    color: #fff;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #3498db;
    border-radius: 0 2px 2px 0;
}

/* 工具提示 */
.nav-item[data-title]:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 70px;
    background-color: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.sidebar.collapsed .nav-item[data-title]:hover::after {
    opacity: 1;
    transform: translateX(5px);
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.user-name {
    white-space: nowrap;
    transition: opacity var(--transition-speed);
}

.sidebar.collapsed .user-name {
    opacity: 0;
    width: 0;
}

.logout-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.1);
}

.logout-btn:hover {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    transform: rotate(360deg);
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: margin-left var(--transition-speed) ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: calc(var(--sidebar-collapsed-width) - var(--sidebar-width));
}

/* 顶部导航栏 */
.top-bar {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--content-padding);
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    z-index: 5;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 5px;
    position: relative;
}

.page-title p {
    color: var(--gray);
    font-size: 0.9rem;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 搜索栏 */
.search-bar {
    position: relative;
    width: 240px;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: none;
    border-radius: var(--radius);
    background-color: var(--gray-light);
    transition: all 0.3s;
}

.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    transition: color 0.3s;
}

.search-bar input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
    background-color: #fff;
}

.search-bar input:focus + i {
    color: var(--primary);
}

/* 通知和设置图标 */
.notification, .setting {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gray-light);
    color: var(--gray);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.notification:hover, .setting:hover {
    background-color: #e0e0e0;
    color: var(--primary);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--danger);
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 内容区域 */
.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: var(--content-padding);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.content-wrapper::-webkit-scrollbar {
    width: 6px;
}

.content-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.content-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

/* 导航链接 */
.navigation-links {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 10px;
}

.nav-link {
    padding: 10px 16px;
    color: var(--gray);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    margin-right: 10px;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* 页面内容 */
.page-content {
    max-width: 100%;
    margin: 0 auto;
}

/* 区块标题 */
.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gray-dark);
    margin: 30px 0 20px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 3px;
}

/* 内容卡片 */
.content-card {
    background-color: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 24px;
    transition: all 0.3s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.content-card:hover {
    box-shadow: var(--shadow);
}

.content-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.content-card-title i {
    margin-right: 10px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: white;
    border-radius: 6px;
    font-size: 14px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 60px;
        overflow: hidden;
    }
    
    .sidebar.mobile-active {
        max-height: 100vh;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .top-bar {
        flex-direction: column;
        height: auto;
        padding: 15px;
        align-items: flex-start;
    }
    
    .top-bar-actions {
        width: 100%;
        margin-top: 15px;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .navigation-links {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
    }
    
    .content-wrapper {
        padding: 15px;
    }
    
    .page-content {
        padding: 0;
    }
}

/* 移动设备侧边栏覆盖层 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 移动菜单按钮 */
.mobile-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow);
    border: none;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s;
}

.mobile-toggle:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }
} 